package com.bjpowernode.controller;

import com.bjpowernode.model.TDicValue;
import com.bjpowernode.result.R;
import com.bjpowernode.service.DicService;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class DicController {

    @Resource
    private DicService dicService;

    @GetMapping(value = "/api/dic/{typeCode}")
    public R dicValue(@PathVariable(value = "typeCode") String typeCode) {
        List<TDicValue> tDicValueList = dicService.getDicValueByTypeCode(typeCode);
        return R.OK(tDicValueList);
    }
}

